typedef struct
{
- GtkOrientation orientation;
gint16 spacing;
guint homogeneous : 1;
GParamSpec *pspec)
{
GtkBox *box = GTK_BOX (object);
- GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkLayoutManager *box_layout = gtk_widget_get_layout_manager (GTK_WIDGET (box));
switch (prop_id)
case PROP_ORIENTATION:
{
GtkOrientation orientation = g_value_get_enum (value);
- if (priv->orientation != orientation)
+ if (gtk_orientable_get_orientation (GTK_ORIENTABLE (box_layout)) != orientation)
{
- priv->orientation = orientation;
- gtk_orientable_set_orientation (GTK_ORIENTABLE (box_layout),
- priv->orientation);
- gtk_widget_update_orientation (GTK_WIDGET (box), priv->orientation);
- g_object_notify (object, "orientation");
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (box_layout), orientation);
+ gtk_widget_update_orientation (GTK_WIDGET (box), orientation);
+ g_object_notify_by_pspec (G_OBJECT (box), pspec);
}
}
break;
GParamSpec *pspec)
{
GtkBox *box = GTK_BOX (object);
- GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
GtkBoxLayout *box_layout = GTK_BOX_LAYOUT (gtk_widget_get_layout_manager (GTK_WIDGET (box)));
switch (prop_id)
{
case PROP_ORIENTATION:
- g_value_set_enum (value, priv->orientation);
+ g_value_set_enum (value, gtk_orientable_get_orientation (GTK_ORIENTABLE (box_layout)));
break;
case PROP_SPACING:
g_value_set_int (value, gtk_box_layout_get_spacing (box_layout));
static void
gtk_box_init (GtkBox *box)
{
- GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
-
- priv->orientation = GTK_ORIENTATION_HORIZONTAL;
- gtk_widget_update_orientation (GTK_WIDGET (box), priv->orientation);
+ gtk_widget_update_orientation (GTK_WIDGET (box), GTK_ORIENTATION_HORIZONTAL);
}
static GtkBuildableIface *parent_buildable_iface;